<?php
$prev_post = get_adjacent_post(false, '', true);
$next_post = get_adjacent_post(false, '', false);
$post_meta = get_post_meta(get_the_ID());
$pTitle    = '';
$pHeader   = '';
$pContent  = '';
$isEn      = is_en();

if(!$isEn){
	$pTitle    = $post_meta['ec_title_vi'][0];
	$pContent  = $post_meta['ec_desc_content_vi'][0];
	$pHeader   = $post_meta['ec_desc_header_vi'][0];
} else {
	$pTitle    = get_the_title();
	$pHeader   = $post_meta['ec_desc_header_en'][0];
	$pContent  = $post_meta['ec_desc_content_en'][0];
}

?>
<div class="row">
	<div class="col-md-9 col-xs-7 col-sm-9">
		<h3 class="title"><?php echo $pTitle; ?></h3>
		<p><strong><?php echo $pHeader; ?></strong></p>
	</div>
	<div class="col-md-3 col-xs-5 col-xs-3">
		<ul class="pager pull-right">
			<?php 
				if($prev_post!='') {
					$prev_meta = get_post_meta($prev_post->ID);
					$prev_post->post_title = $isEn?$prev_post->post_title:$prev_meta['ec_title_vi'][0];
			?>
			<li><a title="<?php echo $prev_post->post_title; ?>" href="<?php echo url_by_lang($prev_post->ID); ?>"><?php echo _trans('title.prev'); ?></a></li>
			<?php } ?>

			<?php 
				if($next_post!='') { 
					$next_meta = get_post_meta($next_post->ID);
					$next_post->post_title = $isEn?$next_post->post_title:$next_meta['ec_title_vi'][0];
			?>
			<li><a title="<?php echo $next_post->post_title; ?>" href="<?php echo url_by_lang($next_post->ID); ?>"><?php echo _trans('title.next'); ?></a></li>
			<?php } ?>
		</ul>
	</div>
	<div class="clearfix"></div>
</div>

<div class="row">
	<div class="col-md-12 col-xs-12">
		<?php echo $pContent; ?>
	</div>
</div>